package com.bwie.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author : LeiMingkun
 * @date : 2024-09-09 15:49
 * @description : RabbitConfig
 **/
@Configuration
public class RabbitConfig {
    @Bean
    public Queue messageQueue(){
        return new Queue("messageQueue",true);
    }
    @Bean
    public Exchange messageExchange(){
        return new DirectExchange("messageExchange");
    }
    @Bean
    public Binding messageBinding(){
        return BindingBuilder.bind(messageQueue()).to(messageExchange()).with("bwie").noargs();
    }
}